package com.woniuxy01;

class FatherClass{
    public void test(){
        System.out.println("father-test");
    }
}
class SonClass extends FatherClass{
    public void test(){
        System.out.println("son-test");
    }
}
class SonClass1 extends FatherClass{
    public void test(){
        System.out.println("son1-test");
    }
}
class SonClass2 extends FatherClass{
    public void test(){
        System.out.println("son2-test");
    }
}

public class Test02 {
    public static void main(String[] args) {
//        FatherClass fc = new FatherClass();
//        SonClass sc = new SonClass();
//        fc=sc;
//        fc.test();
//        sc.test();

//        FatherClass fc=new SonClass();
//        fc.test();
//        fc=new SonClass1();
//        fc.test();
//        fc=new SonClass2();
//        fc.test();

        FatherClass fc = new FatherClass();
        SonClass1 son1 = new SonClass1();
        SonClass son2 = new SonClass();
        SonClass2 son3 = new SonClass2();
    }
}
